package com.kynnnn.cloud.springboot_quartz.task;

import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Zhudiwei
 * @date 2021/10/13
 **/
@Slf4j
public class Task02 extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        JobKey key = context.getJobDetail().getKey();
        log.debug("[{}]-[{}]-[{}]",
                key.getName(),
                key.getGroup(),
                new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())
        );
    }
}
